#define _CRT_SECURE_NO_WARNINGS 1

#include<iostream>
using namespace std;

class A
{
public:
	A(int a = 0)
		:_a(a)
	{
		cout << "A():" << this << endl;
	}
	~A()
	{
		cout << "~A():" << this << endl;
	}
private:
	int _a;
};

void Test()
{
	int* p1 = (int*)malloc(sizeof(int));
	int* p2 = new int;
	int* p3 = new int[5];
	int* p4 = new int(5);

	int* p5 = new int[5]{ 1,2,3,4,5 };
	free(p1);
	delete p2;
	delete[] p3;
	delete p4;
	delete[] p5;
}

int main()
{
	Test();
	A* p2 = new A(10);
	
	delete p2;

	A* p3 = new A[10]{1,2,3,4,5,6,7,8,9,10};
	delete[] p3;
	return 0;
}